package com.restaurant.application.qrcode.support;

import com.nebutown.base.ViewSpec;
import com.nebutown.base.data.ViewUpdate;
import com.nebutown.description.data.UnitForGeneration;
import com.nebutown.generation.PickableBean;
import com.nebutown.generation.basictype.UID;
import com.nebutown.supporthome.AbstractBase;
import com.nebutown.supporthome.CmdCapsule;
import com.restaurant.application.qrcode.QrCodeImpl;

public class QrCodeBase extends AbstractBase {
    private UnitForGeneration desc = new UnitForGeneration();

    public AbstractQrCode getImpl() {
        AbstractQrCode inst = new QrCodeImpl();
        inst.setBase(this, getEscort());
        return inst;
    }

    @Override
    public QrCodeOutFace getUnitFace() {
        return new QrCodeOutFace(this);
    }

    @Override
    protected Object callDistr(String name, Object... param) {
        switch (name) {
            case "createQr":
                getImpl().createQr((String) param[0], (UID) param[1], (String) param[2], (Integer) param[3]);
                return "";
            case "getId":
                return getImpl().getId();
            case "getEffectiveInterface":
                return getImpl().getEffectiveInterface();
            case "getFullView":
                setIsRefresher();
                return getImpl().getFullView();
            case "getViewLead":
                return getImpl().getViewLead((ViewSpec) param[0]);
        }
        return null;
    }

    @Override
    protected boolean authDistr(String name) {
        switch (name) {
        }
        return true;
    }

    @Override
    public CmdCapsule getUICall(int cmd) {
        switch (cmd) {
        }
        return null;
    }

    @Override
    public ViewUpdate uiCall(int cmd, PickableBean param, int... seq) {
        switch (cmd) {
        }
        return null;
    }
}
